import nunjucks from "nunjucks"

export const regTemplating =function (){
    return async (ctx,next) =>{
        let env =  nunjucks.configure('./views',{autoescape: true, noCache: true });
        ctx.render = function (view,obj){
            ctx.body = env.render(view, obj || {})
        }
        await next();
    }
    
}